<?php

namespace app\api\controller\xyvenue;
use app\common\controller\Api;

use app\api\model\xyvenue\order\Order as OrderModel;


/**
 * 定场订单接口
 */
class Order extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
    

    /**
	 * 列表
	 */
	public function lists()
    {
    	$params = $this->request->post();
        $data = OrderModel::getLists($params);
        $this->success('订单列表', $data);
    }

    /**
	 * 订单支付加载数据
	 */
	public function init()
    {
    	$params = $this->request->post();
        $data = OrderModel::getInitData($params);
        $this->success('订单数据', $data);
    }

    /**
     * 使用优惠券
     */
    public function useCoupon(){
        $params = $this->request->post();
        $data = OrderModel::useCoupon($params);
        $this->success('使用成功', $data);
    }

    
	public function add()
    {
        $params = $this->request->post();
        $order = OrderModel::addOrder($params);
        $this->success('添加成功', $order);
    }

    public function detail()
    {
        $params = $this->request->post();
        $this->success('订单详情', OrderModel::getDetail($params));
    }

    public function cancel()
    {
        $params = $this->request->post();
        $this->success('取消成功', OrderModel::cancelOrder($params));
    }

    //退订
    public function refund(){
        $params = $this->request->post();
        $this->success('退订成功', OrderModel::refundOrder($params));
    }
	
	
}